From c4b2f8b295e2c1320349c5050cc9cc762813e83a Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 16 Mar 2007 16:22:29 +0000 Subject: [PATCH] hvm ioemu: Add support for IOREQ_TYPE_XCHG in qemu-dm. From: Trolle Selander Signed-off-by: Keir Fraser --- tools/ioemu/target-i386-dm/helper2.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/ioemu/target-i386-dm/helper2.c b/tools/ioemu/target-i386-dm/helper2.c index 7a5f3412c9..17261e632d 100644 --- a/tools/ioemu/target-i386-dm/helper2.c +++ b/tools/ioemu/target-i386-dm/helper2.c @@ -439,6 +439,18 @@ void cpu_ioreq_xor(CPUState *env, ioreq_t *req) req->data = tmp1; } +void cpu_ioreq_xchg(CPUState *env, ioreq_t *req) +{ + unsigned long tmp1; + + if (req->data_is_ptr != 0) + hw_error("expected scalar value"); + + read_physical(req->addr, req->size, &tmp1); + write_physical(req->addr, req->size, &req->data); + req->data = tmp1; +} + void __handle_ioreq(CPUState *env, ioreq_t *req) { if (!req->data_is_ptr && req->dir == IOREQ_WRITE && req->size != 4) @@ -463,6 +475,9 @@ void __handle_ioreq(CPUState *env, ioreq_t *req) case IOREQ_TYPE_XOR: cpu_ioreq_xor(env, req); break; + case IOREQ_TYPE_XCHG: + cpu_ioreq_xchg(env, req); + break; default: hw_error("Invalid ioreq type 0x%x\n", req->type); } -- 2.30.2